<template>
    <h2>用户还款页面</h2>
    <table>
        <thead>
            <tr>
                <td>借款款项编号</td>
                <td>账户名称</td>
                <td>借款款项名称</td>
                <td>应还款</td>
                <td>还款金额</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="item in data" :key="item.B_Id">
                <td>{{ item.B_Id }}</td>
                <td>{{ item.Name }}</td>
                <td>{{ item.B_Name }}</td>
                <td>{{ item.B_Max }}</td>
                <td>{{ item.A_Mon }}</td>

                <td><input type="button" @click="User()" value="理财赎回"></td>
            </tr>
        </tbody>
    </table>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router';
import { onMounted } from 'vue';
const route = useRoute();
const B_Id = route.params.B_Id;
const data = ref([{
    B_Id: 0,
    B_Name: '',
    A_Mon: 0,
    Name: 0,
    I_Inser: 0,
    B_Max: 0
}])

onMounted(() => {
    Show();
})

const Show = () => {
    axios.get('http://localhost:57910/api/Demo/Await', {
        params: {
            B_Id: B_Id
        }
    })
        .then(res => {
            data.value = res.data
        })
}

const router = useRouter();
const User = () => {
    router.push('/Invest')
}

</script>